<?php
class Userimages_Model_Updateimage implements Userimages_Model_Mainable{
    
    private $core_controller_notnull;
    private $core_controller_csrftoken;
    
    private $excepted_result = 1;
    private $actual_result;
    
    private $userimages_data_updateimage;
    
    public function main(array $variables = null) {
        $this->core_controller_notnull = new Core_Controller_Notnull;
        $this->core_controller_notnull->main($variables);
        $this->core_controller_csrftoken = new Core_Controller_Tokencheckout;
        $this->core_controller_csrftoken->main($variables['post']);
        
        $this->userimages_data_updateimage = new Userimages_Data_Updateimage;
        $this->actual_result = $this->userimages_data_updateimage->main($variables);
        if(
                $this->actual_result == $this->excepted_result
                ){
            header("Location:".SITE_ROOT."zdjecia-uzytkownika.html");
        }
        else {
            header("Location:".SITE_ROOT."zdjecia-uzytkownika.html");
        }
        
    }

}
